<?php
if(!defined("CONFIRMDIALOG")) {
    define("CONFIRMDIALOG", true);
?>

<?php
$this->beginWidget('zii.widgets.jui.CJuiDialog', array(
    'id'=>'confirmationModalDialog',
    // additional javascript options for the dialog plugin
    'options'=>array(
        'autoOpen'=>false,
        'title'=>"Confirm Dialog"
    ),
));

    echo '<div id="confirmationModalDialogContent"></div>';

$this->endWidget('zii.widgets.jui.CJuiDialog');

?>

<script type="text/javascript">

function ale(c) {
    alert(c);
}

function openConfirmationModalDialog(modalContent, onYesCallback) {
    $("#confirmationModalDialogContent").html(modalContent);
    $("#confirmationModalDialogContent").dialog({
        buttons: [
            {
                text    :   "Yes",
                id      :   "Test",
                click   :   function() { onYesCallback(); }
            }
        ]
    });
}

function closeConfirmationModalDialog() {
    $("#confirmationModalDialogContent").dialog("close");
}

</script>

<?php
}
?>